package com.example.ymm.util;

public class RedisKeyManager {

    /**
     * pc 登录token
     */
    public static String pc_token_key ="pc:token:";

    /**
     * 用户 登录token
     */
    public static String user_token_key ="user:token:";

    public static String book_permissions_key ="book:permissions:";

    public static String user_lock_book ="user:lock:book:";

    public static String h5_jsapi_key ="h5:jsapi";

    /**
     * h5 用户 免登token
     */
    public static String h5_user_token_key ="user:token:h5:";

    /**
     * 团队 考试 key
     * @param key
     * @param value
     * @return
     */
    public static String  team_paper_key="team_paper:publishPaperId:";

    /**
     * 面试 考试 key
     * @param key
     * @param value
     *
     * user_paper_key : user:具体userPaperId如'1935519605108989954':
     * @return
     */
    public static String  user_paper_key="user_paper:";


    /**
     * 钉钉小程序token
     */
    public static String  dd_mini_access_token ="dd_mini_access_token";

    /**
     * 获取token的锁
     * 钉钉小程序token
     */
    public static String  dd_mini_access_lock ="dd_mini_access_lock";


    /**
     * 钉钉h5  token
     */
    public static String  dd_h5_access_token ="dd_h5_access_token";

    /**
     * 获取token的锁
     * 钉钉h5token
     */
    public static String  dd_h5_access_lock ="dd_h5_access_lock";

    /**
     * dkn  token
     */
    public static String  dkn_access_token ="dkn_access_token";

    /**
     * 获取token的锁
     * 钉钉dkn token
     */
    public static String  dkn_access_lock ="dkn_access_lock";


    public static String  makeRedisKey(String key,String value){
        if(UtilValidate.isNotEmpty(value)){
            return  key.replace("{KEY}",value);
        }else{
            return key.replace("{KEY}","");
        }
    }


    public static String PIAODU_CACHE_KEY="SHIRO:REDIS:CACHE:{KEY}";

}
